import {request} from "../../request/index.js"
Page({
  data:{
    myInterest:'',
  },
  async onLoad(){
    //  const res=await request({url:"/checkInterest",method:"POST"});
    this.checkInterest();
    //  console.log(res.data.results);

  },
  async checkInterest(){
    // 查询interest表，得到关注的所有用户
    const res=await request({url:"/checkInterest",method:"POST"});
    this.setData({
      myInterest:res.data.results
     })
  },
  async handleDelete(e){
    // 不再关注 删除数据库中该条数据
     const forumname = e.currentTarget.dataset.id;     
     const res=await request({url:"/deleteInterest",method:"POST",data:{forumname}});
     console.log(res.data.results);
     
     this.checkInterest();
  }
})